<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;

    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
        width: 80px;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
    }
  }
}
</style>

<template>
  <div class="panel">
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">项目名称</div>
        <div class="panel-content__item-value">{{item.name||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">决定文书号</div>
        <div class="panel-content__item-value">{{item.document_no||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">许可决定日期</div>
        <div class="panel-content__item-value">{{item.decide_date||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">许可截止日期</div>
        <div class="panel-content__item-value">{{item.expire_date||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">许可状态</div>
        <div class="panel-content__item-value">{{item.status||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">审判类别</div>
        <div class="panel-content__item-value">{{item.type||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">地域</div>
        <div class="panel-content__item-value">{{item.provinceName||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">许可机关</div>
        <div class="panel-content__item-value">{{item.office_no||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">许可内容</div>
        <div class="panel-content__item-value">{{item.content||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>

  </div>
</template>
<script>
export default {
  data() {
    return {
      item: {
        // Id: '63AE6A7A226A88C0',
        // Category: '30200-0000',
        // RegisterNo: '2018SR716864',
        // Name: '小稽快跑软件',
        // ShortName: '小稽快跑',
        // Owner: '深圳市紫石文化传播有限公司',
        // VersionNo: 'V1.0',
        // PublishDate: '2018-08-02',
        // RegisterAperDate: '2018-09-05',
        // NameKeyNoCollection: [
        //   {
        //     Name: '深圳市紫石文化传播有限公司',
        //     KeyNo: '64a5c797f27d5072a12012470eafa5d1'
        //   }
        // ]
      }
    };
  },
  onShow() {
    this.getData();
  },
  onUnload() {
    this.item = {};
    console.log('清理内容');
  },
  methods: {
    async getData() {
      // 获取详情
      const url = '/xcx/getAdministrativeLicenseDetail';
      const params = {
        caseId: this.$root.$mp.page.options.caseId
      };
      const res = await this.$http.get(url, params);
      if (res.status != 200) {
        wx.showToast({
          title: res.message || '获取失败！',
          icon: 'none',
          mask: true
        });
        return;
      }
      const result = res.result;
      this.item = result;
    }
  }
};
</script>
